package com.kfm.base.thread.day01;

public class Demo05 {

    public static void main(String[] args) {
        Runnable r = () -> {
            for (int i =0; i < 10; i++){
                System.out.println(Thread.currentThread().getName() + i);
            }
        };

        Thread t1 = new Thread(r);

        t1.setName("线程");// 线程启动前设置

        System.out.println(t1.getPriority());// 5

        // 优先级的设置要在线程启动前设置
        t1.setPriority(Thread.MAX_PRIORITY); // 最高优先级


        Thread t2 = new Thread(r, "A");

        t2.start();
        t1.start();
    }
}
